import request from '@/config/axios'

export interface LabelVO {
        id: number
        name: string
        bgColor: string
        textColor: string
        setId: number
        sort: number
}

// 查询客户标签列表
export const getLabelPage = async (params) => {
    return await request.get({url: `/crm/label/page`, params})
}

// 查询客户标签详情
export const getLabel = async (id: number) => {
    return await request.get({url: `/crm/label/get?id=` + id})
}

// 新增客户标签
export const createLabel = async (data: LabelVO) => {
    return await request.post({url: `/crm/label/create`, data})
}

// 修改客户标签
export const updateLabel = async (data: LabelVO) => {
    return await request.put({url: `/crm/label/update`, data})
}

// 删除客户标签
export const deleteLabel = async (id: number) => {
    return await request.delete({url: `/crm/label/delete?id=` + id})
}

// 导出客户标签 Excel
export const exportLabel = async (params) => {
    return await request.download({url: `/crm/label/export-excel`, params})
}